<?php

if(empty($_POST))
{
	include('login_html.php');
}
else
{
	$u=$_POST['username'];
	$p=$_POST['password'];
	setcookie('username',$u,time()+60*5);
	if (($u=='admin') and ($p=='123456'))
	{
		header("Location:index.php");
	}
	else{
		echo "<script>";
		echo "alert('登录失败！');";
		echo "location='login.php'";
		echo "</script>";
	}
}